#pragma once

#include <interface/interface.h>

struct inet_cfg
{
	int use_proxy;
	int proxy_type;
	std::string proxy_host_name;
	int proxy_port;
	std::string user;
	std::string pwd;

	inet_cfg()
	{
		use_proxy = 0;
	}

	bool read_cfg();
};

class dll_object : public aot::tt::idll
{
public:
	dll_object();
	virtual ~dll_object();
public:
	virtual bool query_interface(void** out, const char* key);
	virtual const char* interface_name(){return "idll.web_service.dll";}

public:
	virtual const char* module_name(){return "web_service.dll";}
	virtual bool on_regist(aot::tt::idll::dll_regist_param_t* p, aot::tt::result_t* ret = NULL);
public:
	void init_log(aot::tt::imain* imain_obj);
	void regist_sys_event(aot::tt::idll::dll_regist_param_t* p);
	int on_sys_event(int event_type, int ev, WPARAM wparam, LPARAM lparam, aot::tt::sys_event_param_t* sep);
	bool is_first_regist_;
	inet_cfg inet_cfg_;
	aot::tt::imain* imain_;
};

extern dll_object* g_dll_obj;